home *** CD-ROM | disk | FTP | other *** search
/ Best Tools for JAVA / Best Tools for JAVA.iso / POSTSCPT / GSVIEW / SRC / GVCEPS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1995-09-14  |  3.2 KB  |  113 lines

  1. /* Copyright (C) 1993, 1994, Russell Lang.  All rights reserved.
  2.   
  3.   This file is part of GSview.
  4.   
  5.   This program is distributed with NO WARRANTY OF ANY KIND.  No author
  6.   or distributor accepts any responsibility for the consequences of using it,
  7.   or for whether it serves any particular purpose or works at all, unless he
  8.   or she says so in writing.  Refer to the GSview Free Public Licence 
  9.   (the "Licence") for full details.
  10.   
  11.   Every copy of GSview must include a copy of the Licence, normally in a 
  12.   plain ASCII text file named LICENCE.  The Licence grants you the right 
  13.   to copy, modify and redistribute GSview, but only under certain conditions 
  14.   described in the Licence.  Among other things, the Licence requires that 
  15.   the copyright notice and this notice be preserved on all copies.
  16. */
  17.  
  18. /* gvceps.h */
  19. /* Common data structures for EPS manipulation */
  20.  
  21. /* because Windows and PM define the same bitmap structures  */
  22. /* with different names we use our own common structures */
  23. /* BITMAP1 = Windows BITMAPCORE and PM BITMAPINFO */
  24. /* BITMAP2 = Windows BITMAPINFO and PM BITMAPINFO2 */
  25. /* RGB3 = Windows RGBTRIPLE and PM RGB */
  26. /* RGB4 = Windows RGBQUAD and PM RGB2 */
  27.  
  28. #ifdef __EMX__
  29. #pragma pack(1)        /* align structures to byte boundaries */
  30. #endif
  31.  
  32. typedef struct tagRGB3
  33. {
  34.     BYTE    rgbtBlue PACKED;
  35.     BYTE    rgbtGreen PACKED;
  36.     BYTE    rgbtRed PACKED;
  37. } RGB3;
  38. typedef RGB3 GVFAR* LPRGB3;
  39.  
  40. typedef struct tagRGB4
  41. {
  42.     BYTE    rgbBlue PACKED;
  43.     BYTE    rgbGreen PACKED;
  44.     BYTE    rgbRed PACKED;
  45.     BYTE    rgbReserved PACKED;
  46. } RGB4;
  47. typedef RGB4 GVFAR* LPRGB4;
  48.  
  49. typedef struct tagBITMAP1
  50. {
  51.     DWORD   bcSize PACKED;
  52.     short   bcWidth PACKED;
  53.     short   bcHeight PACKED;
  54.     WORD    bcPlanes PACKED;
  55.     WORD    bcBitCount PACKED;
  56. } BITMAP1;
  57. typedef BITMAP1 GVFAR* LPBITMAP1;
  58.  
  59. typedef struct tagBITMAP2
  60. {
  61.     DWORD   biSize PACKED;
  62.     LONG    biWidth PACKED;
  63.     LONG    biHeight PACKED;
  64.     WORD    biPlanes PACKED;
  65.     WORD    biBitCount PACKED;
  66.     DWORD   biCompression PACKED;
  67.     DWORD   biSizeImage PACKED;
  68.     LONG    biXPelsPerMeter PACKED;
  69.     LONG    biYPelsPerMeter PACKED;
  70.     DWORD   biClrUsed PACKED;
  71.     DWORD   biClrImportant PACKED;
  72. } BITMAP2;
  73. typedef BITMAP2 GVFAR* LPBITMAP2;
  74.  
  75. typedef struct tagBITMAPFILE
  76. {
  77.     WORD    bfType PACKED;
  78.     DWORD   bfSize PACKED;
  79.     WORD    bfReserved1 PACKED;
  80.     WORD    bfReserved2 PACKED;
  81.     DWORD   bfOffBits PACKED;
  82. } BITMAPFILE;
  83. typedef BITMAPFILE GVFAR* LPBITMAPFILE;
  84.  
  85.  
  86. struct eps_header_s {
  87.     char id[4] PACKED;
  88.     DWORD ps_begin PACKED;
  89.     DWORD ps_length PACKED;
  90.     DWORD mf_begin PACKED;
  91.     DWORD mf_length PACKED;
  92.     DWORD tiff_begin PACKED;
  93.     DWORD tiff_length PACKED;
  94.     WORD  checksum PACKED;
  95. };
  96.  
  97. #ifdef __EMX__
  98. #pragma pack()
  99. #endif
  100.  
  101. /* in gvpeps.c or gvweps.c */
  102. LPBITMAP2 get_bitmap(void);
  103. void release_bitmap(void);
  104.  
  105. /* in gvceps.c */
  106. unsigned long dib_bytewidth(LPBITMAP2 pbm);
  107. unsigned int dib_pal_colors(LPBITMAP2 pbm);
  108. int make_eps_tiff(int type, BOOL calc_bbox);
  109. int make_eps_interchange(BOOL calc_bbox);
  110. int make_eps_user(void);
  111. void extract_doseps(int command);
  112. void copy_bbox_header(FILE *f);
  113.